#include<iostream>
#include<cstring>
#include<vector>
using namespace std;

int Solution(int minSize,int maxSize,vector<int> tank)
{
  int count = 0;
  bool canPut[1001];
  memset(canPut,true,sizeof(canPut));
  // 检查浴缸里的鱼会不会吃掉加入的鱼
  for(int fish:tank)
  {
    // 会吃掉缸内鱼的大小
    for(int i=2*fish;i<=maxSize && i<=10*fish;i++)
      canPut[i] = false;
    // 会被缸内鱼吃掉
    for(int i=fish/2;i>=minSize && i>=fish/10;i--)
      canPut[i] = false;
  }

  for(int i=minSize;i<=maxSize;i++)
  {
    if(canPut[i])
      count++;
  }
  return count;
}

int main()
{
  int minSize,maxSize,n;
  cout<<"请输入minSize，maxSize:";
  cin>>minSize>>maxSize;
  cout<<"请输入鱼缸里面已经有鱼的数量n:";
  cin>>n;
  
  vector<int> tank;
  cout<<"请输入鱼缸里鱼的大小:";
  for(int i=0;i<n;)
  {
    int size;
    cin>>size;
    if(size>=1 && size<=1000)
    {
      i++;
      tank.push_back(size);
    }
    else
    {
      cout<<"鱼的大小应在1-1000之间"<<endl;
    }
  }
  
  cout<<Solution(minSize,maxSize,tank)<<endl;

  return 0;
}
